<?
class ControllerPath extends Controller{
	public function _bind(){
		$method = "";
		$params = explode(':', $_SERVER['QUERY_STRING']);
		$params = preg_split('/[:&]/', $_SERVER['QUERY_STRING']);
		
		$method = array_shift($params);
		if(!$method) $method = 'index';
		//if($method == '~') $method = 'index';
		if($method && $method{0} === '_') die("forbidden method");
		if(!method_exists($this, $method)) $method = 'index';
		Output::assign("_method", $method);
		
		if(!method_exists($this, $method)) throw new Exception("method index doesn't exists");
		
        call_user_func_array(array($this, $method), $params);			
	}
}
?>